<%@ page language="java" import="java.util.*,com.entity.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://jsptags.com/tags/navigation/pager" prefix="pg"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    <title>用户信息</title>
  </head>
  <link rel="stylesheet" type="text/css" href="css/style.css">
    <script src="/inc/js/ccorrect_btn.js"></script>
  <body>
  <%   Dlyh dlyh =(Dlyh) request.getSession().getAttribute("dlyh");
  System.out.println(dlyh.getDlyhmm()+"  "+dlyh.getZd().getTypename()+"0.0.0.0.0");
  %>
  <div style="margin-left: 20%">
			<%if((dlyh.getZd().getTypename().endsWith("县")||dlyh.getZd().getTypename().endsWith("区")||dlyh.getZd().getTypename().equals("武安市"))&&!dlyh.getZd().getTypename().equals("工业园区")){ %>
            <input type="button" value="添加用户" 
					onClick="location='dlyh.do?state=add';" title="添加用户">
					<%} %>
            </div>
  <div class="PageHeader">
            
		</div>
		

  <pg:pager url="dlyh.do" index="half-full" maxPageItems="10"
			maxIndexPages="5" isOffset="<%=false%>"
			export="pageOffset,currentPageNumber=pageNumber" scope="request">
    <table class="TableList" border=1 align="center" >
       
       <tr class="TableHeader">
          <td nowrap align="center" width="300">用户名</td>
          <td nowrap align="center" width="150">单位</td>
          <td nowrap align="center" width="150">操作</td>
       </tr>
       <%List list =(List) request.getAttribute("dlyhlist");
         Iterator it = list.iterator();
         while(it.hasNext())
         {
            Object[] o = (Object[])it.next(); 
            Dlyh yh =(Dlyh)o[0]; 
            Zd zd = (Zd)o[1]; 
          %>
          <pg:item>
           <tr class="TableData">
             <td nowrap align="center"><%=yh.getDlyhmc() %></td>
             <td nowrap align="center"><%=zd.getZdqc() %> </td>
             <td nowrap align="center">
              <%if((dlyh.getZd().getTypename().endsWith("县")||dlyh.getZd().getTypename().endsWith("区")||dlyh.getZd().getTypename().equals("武安市"))&&!dlyh.getZd().getTypename().equals("工业园区"))
               {
                  %>
 				 <a href="dlyh.do?state=delete&yhid=<%=yh.getId() %>" onClick="return confirm('会删除所有连带信息，确定要删除吗？');">删除</a>/<a href="dlyh.do?state=update&yhid=<%=yh.getId() %>">更新</a>
 				 <%}
 				  else
 				  {%>
 				     删除/更新
 				  <%}
 				  %>
             </td>
           </tr>
            </pg:item>
         <%}
        %>
    </table>
      <pg:index>
				<center>
					<table border=0 cellpadding="5" cellspacing=0" style="font-size: 12px">
						<tr align="center" valign="top">
							<td valign="bottom"><br /></td>
							<pg:prev ifnull="true">
								<%if (pageUrl != null) {%>
                                <td align=right>
                                   
									<A HREF="<%=pageUrl%>&state=findall&pageNo=<%=pageNumber%>">上一页<br />
									</A>
								</td>
								<%} else {%>
								<td>
									上一页
								</td>
								<%}%>
							</pg:prev>
							<pg:pages>
								<%if (pageNumber == currentPageNumber) {%>
								<td>
									<font color=#A90A08><%=pageNumber%></font>
								</td>
								<%} else {%>
								<td>
									<A HREF="<%=pageUrl%>&state=findall&pageNo=<%=pageNumber%>"> <%=pageNumber%></A>
								</td>
								<%}%>
							</pg:pages>
							<pg:next ifnull="true">
								<%if (pageUrl!= null) {%>
								<td>
									<A HREF="<%=pageUrl%>&state=findall&pageNo=<%=pageNumber%>">下一页<br /></A>
								</td>
								<%} else {%>
								<td>
									下一页
								</td>
								<%}%>
							</pg:next>
						</tr>
					</table>
				</center>
			</pg:index>

		</pg:pager>
  </body>
</html>
